Conversation
…gleton audio_player_* functionality.
…api); Add support for audio mixer of N streams.
…io_stream_type_t enum
…, for now adding a shim to set state by event on a raw stream. Callback is fired upon setting (on callers task)
|
@robert-alfaro this is an impressive PR, thank you so much. Could I ask what might have driven the development of this feature? I went through each commit, didn't see anything too concerning, are there any areas where you'd like me to focus on in terms of review? |
thanks -- honestly the same two reasons this lib exists -- really we just needed a simple audio mixer without the overhead of esp-adf and keeping things opensource. Having minimal dependencies keeps options open as we adapt over time. This now allows for having background music + sfx on top. It is flexible enough to receive audio frames from a FILE handle or from a pcm stream like USB Audio, for example. Additionally, I've added a stream level queue for immediately sequencing multiple audio assets. In terms of review, I don't think anything in particular stands out... I did try to preserve the original singleton behavior. Whether that approach forever remains is not up to me. The only caveat with the mixer right now is all the stream instances need to submit the same format, i.e. rate/bits/ch, as that'd require resampling. |
|
@robert-alfaro well this looks quite good, merging it in now, thank you for the contribution! |
This PR introduces a major feature to the esp-audio-player component: Audio Mixer support.
The mixer allows simultaneous playback of multiple audio sources (streams) by mixing their PCM data into a single I2S output. This addition significantly enhances the flexibility of the audio player, enabling use cases like background music mixed with sound effects or multiple concurrent voice prompts.